package com.yuanfeng.commoms.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.math.BigDecimal;

@Component
public class WXPayConfig {
	@Value("${domainName}")
	public  String domainName ;

	@PostConstruct
	public  String getDomainNameUrl() {
		PLATFORM_URL = this.domainName + "/ShoppingPayment/";
		VIDEO_PAY_NOTIFY = this.domainName + "/ShoppingPayment/pay/videoWxPayNotify/";
		return DOMAIN_NAME_URL = this.domainName;
	}

	/**
	 * 域名
	 */
	public static String DOMAIN_NAME_URL;


	// 导出路径
	public static  String PLATFORM_URL = null ;// 平台后台项目路径



	public static String NOTIFY_URL = "https://java.yuanfengtest.com/ShoppingPayment/WXPay/notifyWeiXinPay";
	public static String APP_ID = "wx4e4622171870b7d5"; // 公众账号appid（改为自己实际的）
	public static String APP_SECRET = "ae108237be5f779411c372c1111232bb";
	public static String MCH_ID = "1564151221"; // 商户号（改为自己实际的）
	public static String API_KEY = "1a0sh2jtW47wbnxzemTC1ZUQHiKKhJEL";
	public static String REDIRECT_URL = "https://javatest.yuanfengtest.com/h5/#/member/orderlist/orderlist";
	public static String weChatWapPath = "/www/server/p12/wap_apiclient_cert.p12";
	// 小程序
	public  static String Applet_APP_ID = "wx8639411a560926cc"; // appid（改为自己实际的）
	public  static String Applet_APP_SECRET = "e5b7082e5ebd1c3f116175ebc5108b60";

	// 公众号
	public static String GZ_APP_ID = "wxf7306d2b08726622"; // appid（改为自己实际的）
	public static String GZ_APP_SECRET = "ae9f5dba3e5fbc6990a5bdc83ed857ed";

	// 退款url
	public static String REFUND_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund";
    // plus 支付回调
    public static  String PLUS_NOTIFY_URL = null ;
	/**
	 * 直播微信回调
	 */
	public static  String VIDEO_PAY_NOTIFY ;

	/**
	 * 单笔最低转账金额0.3元
	 */
	public static final BigDecimal MIN_AMOUNT = new BigDecimal("0.3");

	public static final String BODY_DESC = "交易";

	public static String getCODE_SESSION(){
		String codeSession = "https://api.weixin.qq.com/sns/jscode2session?appid=" + Applet_APP_ID
				+ "&secret=" + Applet_APP_SECRET + "&js_code=" + "%s" + "&grant_type=authorization_code";
		return codeSession ;
	}

}
